import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { DetailVO, DetailForm, DetailQuery } from '@/api/wyl/detail/types';

/**
 * 查询【请填写功能名称】列表
 * @param query
 * @returns {*}
 */

export const listDetail = (query?: DetailQuery): AxiosPromise<DetailVO[]> => {
  return request({
    url: '/wyl/detail/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询【请填写功能名称】详细
 * @param id
 */
export const getDetail = (id: string | number): AxiosPromise<DetailVO> => {
  return request({
    url: '/wyl/detail/' + id,
    method: 'get'
  });
};

/**
 * 新增【请填写功能名称】
 * @param data
 */
export const addDetail = (data: DetailForm) => {
  return request({
    url: '/wyl/detail',
    method: 'post',
    data: data
  });
};

/**
 * 修改【请填写功能名称】
 * @param data
 */
export const updateDetail = (data: DetailForm) => {
  return request({
    url: '/wyl/detail',
    method: 'put',
    data: data
  });
};

/**
 * 删除【请填写功能名称】
 * @param id
 */
export const delDetail = (id: string | number | Array<string | number>) => {
  return request({
    url: '/wyl/detail/' + id,
    method: 'delete'
  });
};
